<?php

class DemoController extends Controller {
    
    public function showMsg($name='') {
        $user       = D('Test')->getUserName();
        $company    = D('Test')->getCompanyName();
        $department = D('Test')->getDepartment();
        
        if ($name) {
            $userInfo = D('User')->getUserInfo($name);
            $this->assign('user_info', $userInfo);
        }
        
        $this->assign('user', $user);
        $this->assign('company', $company);
        $this->assign('department', $department);
        $this->display('showMsg', __CLASS__);
    }
    
}